<div class="form-container">
<div class="validation-errors" id="validationErrors" style="display:none;"></div>
<div class="walk-register-buttons" style="float: left;">
<a href="<?php echo( base_url() ); ?>cmb/member/home/<?php echo( $urlKey ); ?>/" target="_self">Existing Member Home</a>
</div>
<div class="walk-register-buttons" style="float: right;">
	<a href="<?php echo( base_url() ); ?>cmb/member/homepage_logout/"><img src="<?php echo( base_url() ); ?>assets/images/buttons/logout1.gif" border="0" /></a>
</div>
<?php
	Includes::IncludeFile( Includes::$FORM );
	Includes::IncludeFile( Includes::$SPACER );
			
		echo( form_open(base_url() . 'swamivisits/event_registration/release_check_event_process/' .$urlKey.'/', array('id' => 'releaseEventCheckForm') ) );

		//Enter check info
		//----------------------------------------
		Spacer::Render(0, 50);
		$numrel = count($regInfo);
		if ($numrel > 0)
		{
			echo('<b>Enter CHECK Info</b>');
			echo('<hr />');
			foreach($regInfo as $checkInfo)
			{
				Form::OpenFormItem('Registrant First Name:', 260);
					echo( form_label($checkInfo[1], 'pinfo', 'style="width: 20px;" ') );
				Form::CloseFormItem();
				Form::OpenFormItem('Registrant Last Name:', 260);
					echo( form_label($checkInfo[2], 'pinfo', 'style="width: 20px;" ') );
				Form::CloseFormItem();
				Form::OpenFormItem('Registrant Email:', 260);
					echo( form_label($checkInfo[3], 'pinfo', 'style="width: 20px;" ') );
				Form::CloseFormItem();
				Form::OpenFormItem('Number of participants:', 260);
					echo( form_label($checkInfo[4], 'pinfo', 'style="width: 20px;" ') );
				Form::CloseFormItem();
				Form::OpenFormItem('Expected check amount:', 260);
					echo( form_label('$'.$checkInfo[5], 'pinfo', 'style="width: 20px;" ') );
				Form::CloseFormItem();
				Form::OpenFormItem('Event Name:', 260);
					echo( form_label($checkInfo[6], 'pinfo', 'style="width: 20px;" ') );
				Form::CloseFormItem();
				Form::OpenFormItem('Enter Check Number:', 260);
					echo( form_input(array('name'=>'svid'.$checkInfo[0],'id'=>'svid'.$checkInfo[0],'style'=>'width: 250px;')) );
				Form::CloseFormItem();
				Spacer::Render(0, 10);
				
				echo('<hr style="width:50%; size:10; color:#0000FF;" align="left" />');
				
				Spacer::Render(0, 20);	
			}
		}
		else
		{
			echo('<b>No Unreleased Transactions</b>');
		}
		//----------------------------------------
													
		echo( form_close() );
?>
	<?php if($numrel > 0){ ?><div class="form-button-container"><?php } ?>
		<?php if($numrel > 0){ ?><a href="javascript: validate();"><img src="<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif" border="0" onmouseover="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_over1.gif';" onmousedown="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_on1.gif';" onmouseup="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif';" onmouseout="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif';" /></a><?php } ?>
	<?php if($numrel > 0){ ?></div><?php } ?>	

</div>

<script type="text/javascript">
	function validate()
	{
		new Ajax.Request(baseUrl + 'validation/swamivisits_validation/validate_event_release_check/', 
		{
			method:'post',
			parameters: Form.serialize( $('releaseEventCheckForm') ),
		  	onSuccess: function(response)
			{
				var result = response.responseText;
				
				if( result == 'VALIDATION_SUCCESS' )
				{
					$('releaseEventCheckForm').submit();
				}
				else
				{
					$('validationErrors').innerHTML = result;
					$('validationErrors').show();
					Effect.ScrollTo('validationErrors', { duration:'0.2', offset:-20 });
				}
			},
			onFailure: function(response){var result = response.responseText; $('validationErrors').innerHTML = result;
					$('validationErrors').show();alert('failed') }
		});
	}
</script>

<?php if($this->config->item('debug')){ ?>
<script type="text/javascript">
	function populate()
	{
		/* 
		$('userName').value = 'john.doe';
		$('password').value = 'registerthis';
		*/
		$('firstName').value = 'John'
		$('lastName').value = 'Doe'
		$('gender').selectedIndex = 1;
		$('primaryEmail').value = 'john.doe@email.com';
		$('homePhoneNumber').value = '555-555-5555';
		$('mobilePhoneNumber').value = '';
		$('homeAddress1').value = '123 Sunset Blvd';
		$('homeAddress2').value = '';
		$('city').value = 'Lexington'
		$('state').selectedIndex = 22;
		$('zipCode').value = '02421';
	}
</script>
<?php } ?>